#pragma once
#include <iostream>
#include <assert.h>

#include "vector.h"


void test1()
{
	MyVector::Vector<int> v1;
	v1._push_back(0);
	v1._push_back(1);
	v1._push_back(2);
	v1._push_back(3);
	v1._push_back(4);
	v1._push_back(5);
	v1._push_back(6);
	v1._push_back(7);
	v1._push_back(8);
	v1._push_back(9);
	v1._push_back(10);
	v1._push_back(11);

	print_vector(v1);



	MyVector::Vector<int> v2(v1);
	v2._pop_back();
	v2._pop_back();
	v2._pop_back();
	v2._pop_back();
	print_vector(v2);

	for (int i = 0;i < v2._size();i++)
	{
		std::cout << v2[i] << " ";
	}
	const int cj = v1[6];
	std::cout << "     " << cj << std::endl;

	std::cout << (v1._empty()) << "  ";
	v1._clear();
	std::cout << (v1._empty()) << "  ";
	std::cout <<std::endl << std::endl << std::endl;


	print_vector(v1);
	v1 = v2;

	print_vector(v1);

	v1._resize(20, -1);
	print_vector(v1);

	print_vector(v2);
	std::cout << *(v2._front()) << " " << *(v2._back()) << std::endl;

}
void test2()
{
	MyVector::Vector<int> v1;
	v1._push_back(0);
	v1._push_back(1);
	v1._push_back(2);
	v1._push_back(3);
	v1._push_back(4);
	v1._push_back(5);
	v1._push_back(6);
	v1._push_back(7);
	v1._push_back(8);
	v1._push_back(9);
	v1._push_back(10);
	v1._push_back(11);
	int capa = v1._capacity();
	int sz = v1._size();
	print_vector(v1);
	std::cout << capa << ' ' << sz << std::endl;

	/*v1._insert(3, -1);
	print_vector(v1);
	 sz = v1._size();

	v1._insert(sz, -2, 5);
	print_vector(v1);
	v1._insert(0, -3, 50);
	print_vector(v1);*/


	v1._erase(3);
	print_vector(v1);
	v1._erase(3,2);
	print_vector(v1);
	v1._erase(3, 20);
	print_vector(v1);
	v1._erase(0, 20);
	print_vector(v1);


}
void test3()
{
	/*MyVector::Vector<int> v1(12, 1);
	print_vector(v1);*/

	MyVector::Vector<std::string> v1(12, "aaaaa");
	print_vector(v1);
	v1._clear();
	v1._push_back("aa");
	v1._push_back("ab");
	v1._push_back("ac");
	v1._push_back("af");
	v1._push_back("ad");
	v1._push_back("aaa");
	print_vector(v1);

}
int main()
{
	test3();


	return 0;
}